using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

using Smg.DAL;
using Smg.Model;
using Smg.Source;

namespace Smg.DAL
{
    public class DbOp
    {
        public DbOp()
        {
        }

        public static DataSet GetResult(string sql)
        {
            DataSet ds = new DataSet();
            switch(Config.DbType.ToLower())
            {
                case "access":
                    OleDBOpration oleOp = new OleDBOpration(Config.ConnectionString);
                    ds = oleOp.GetResult(sql); break;
                case "mssql":
                    MsSqlDBOpration msqlOp = new MsSqlDBOpration(Config.ConnectionString);
                    ds = msqlOp.GetResult(sql); break;
                default:
                    oleOp = new OleDBOpration(Config.ConnectionString);
                    ds = oleOp.GetResult(sql); break;
            }

            return ds;
        }
    }
}
